﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace A2DFramework.ValidationService.RuleValidators
{
    public class RuleRequiredAttribute:RuleValidationAttribute
    {
        private RequiredAttribute checker;

        public RuleRequiredAttribute():this(string.Empty)
        { 
        }

        public RuleRequiredAttribute(string rule):base(rule)
        {
            checker = new RequiredAttribute();
        }

        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            return checker.GetValidationResult(value, validationContext);
        }
    }
}
